package com.sophossystems.client.asmon.hibernate;

import java.io.Serializable;
import java.util.Date;

import com.sophossystems.client.asmon.dto.UserDTO;

public class User implements Serializable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = -1048845663821293715L;

	/** 
	 * This attribute maps to the column idUser in the User table.
	 */
	protected int idUser;

	/** 
	 * This attribute maps to the column username in the User table.
	 */
	protected String username;

	/** 
	 * This attribute maps to the column password in the User table.
	 */
	protected String password;

	/** 
	 * This attribute maps to the column idRole in the User table.
	 */
	protected int idRole;

	/** 
	 * This attribute represents whether the primitive attribute idRole is null.
	 */
	protected boolean idRoleNull = true;

	/** 
	 * This attribute maps to the column Name in the User table.
	 */
	protected String name;

	/** 
	 * This attribute maps to the column Apellido in the User table.
	 */
	protected String apellido;

	/** 
	 * This attribute maps to the column SegundoApellido in the User table.
	 */
	protected String segundoApellido;

	/** 
	 * This attribute maps to the column ipaddress in the User table.
	 */
	protected String ipaddress;

	/** 
	 * This attribute maps to the column lastlogin in the User table.
	 */
	protected Date lastlogin;

	/** 
	 * This attribute maps to the column status in the User table.
	 */
	protected String status;

	/**
	 * Method 'User'
	 * 
	 */
	public User()
	{
	}

	/**
	 * Method 'getIdUser'
	 * 
	 * @return int
	 */
	public int getIdUser()
	{
		return idUser;
	}

	/**
	 * Method 'setIdUser'
	 * 
	 * @param idUser
	 */
	public void setIdUser(int idUser)
	{
		this.idUser = idUser;
	}

	/**
	 * Method 'getUsername'
	 * 
	 * @return java.lang.String
	 */
	public java.lang.String getUsername()
	{
		return username;
	}

	/**
	 * Method 'setUsername'
	 * 
	 * @param username
	 */
	public void setUsername(java.lang.String username)
	{
		this.username = username;
	}

	/**
	 * Method 'getPassword'
	 * 
	 * @return java.lang.String
	 */
	public java.lang.String getPassword()
	{
		return password;
	}

	/**
	 * Method 'setPassword'
	 * 
	 * @param password
	 */
	public void setPassword(java.lang.String password)
	{
		this.password = password;
	}

	/**
	 * Method 'getIdRole'
	 * 
	 * @return int
	 */
	public int getIdRole()
	{
		return idRole;
	}

	/**
	 * Method 'setIdRole'
	 * 
	 * @param idRole
	 */
	public void setIdRole(int idRole)
	{
		this.idRole = idRole;
		this.idRoleNull = false;
	}

	/** 
	 * Sets the value of idRoleNull
	 */
	public void setIdRoleNull(boolean idRoleNull)
	{
		this.idRoleNull = idRoleNull;
	}

	/** 
	 * Gets the value of idRoleNull
	 */
	public boolean isIdRoleNull()
	{
		return idRoleNull;
	}

	/**
	 * Method 'getName'
	 * 
	 * @return java.lang.String
	 */
	public java.lang.String getName()
	{
		return name;
	}

	/**
	 * Method 'setName'
	 * 
	 * @param name
	 */
	public void setName(java.lang.String name)
	{
		this.name = name;
	}

	/**
	 * Method 'getApellido'
	 * 
	 * @return java.lang.String
	 */
	public java.lang.String getApellido()
	{
		return apellido;
	}

	/**
	 * Method 'setApellido'
	 * 
	 * @param apellido
	 */
	public void setApellido(java.lang.String apellido)
	{
		this.apellido = apellido;
	}

	/**
	 * Method 'getSegundoApellido'
	 * 
	 * @return java.lang.String
	 */
	public java.lang.String getSegundoApellido()
	{
		return segundoApellido;
	}

	/**
	 * Method 'setSegundoApellido'
	 * 
	 * @param segundoApellido
	 */
	public void setSegundoApellido(java.lang.String segundoApellido)
	{
		this.segundoApellido = segundoApellido;
	}

	/**
	 * Method 'getIpaddress'
	 * 
	 * @return java.lang.String
	 */
	public java.lang.String getIpaddress()
	{
		return ipaddress;
	}

	/**
	 * Method 'setIpaddress'
	 * 
	 * @param ipaddress
	 */
	public void setIpaddress(java.lang.String ipaddress)
	{
		this.ipaddress = ipaddress;
	}

	/**
	 * Method 'getLastlogin'
	 * 
	 * @return java.util.Date
	 */
	public java.util.Date getLastlogin()
	{
		return lastlogin;
	}

	/**
	 * Method 'setLastlogin'
	 * 
	 * @param lastlogin
	 */
	public void setLastlogin(java.util.Date lastlogin)
	{
		this.lastlogin = lastlogin;
	}

	/**
	 * Method 'getStatus'
	 * 
	 * @return java.lang.String
	 */
	public java.lang.String getStatus()
	{
		return status;
	}

	/**
	 * Method 'setStatus'
	 * 
	 * @param status
	 */
	public void setStatus(java.lang.String status)
	{
		this.status = status;
	}

	public void mapper(UserDTO user){
		
		this.apellido = user.getApellido();
		this.idRole = user.getIdRole();
		this.idUser = user.getIdUser();
		this.ipaddress = user.getIpaddress();
		this.lastlogin = user.getLastlogin();
		this.name = user.getName();
		this.password = user.getPassword();
		this.segundoApellido = user.getSegundoApellido();
		this.status = user.getStatus();
		this.username = user.getUsername();
	}
}
